package dominio.xml.productsByCategories;

import java.util.LinkedList;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;


@XmlAccessorType(XmlAccessType.FIELD)
public class XMLCategories {
	
	@XmlElement(name="id")
	private Long id;
	
	@XmlElement(name="name")
	private String name;
	
	@XmlElement (name="product")
	private LinkedList<XMLProducts> products;
	
	public XMLCategories(){
		this.products = new LinkedList<XMLProducts>();
	}
	
	public XMLCategories(Long id, String name, LinkedList<XMLProducts> products){
		this.id = id;
		this.products = products;
		this.name = name;
	}
	
	public XMLCategories(Long id, String name){
		this.id = id;
		this.name = name;
		this.products = new LinkedList<XMLProducts>();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public LinkedList<XMLProducts> getProducts() {
		return products;
	}

	public void setProducts(LinkedList<XMLProducts> products) {
		this.products = products;
	}
	
	public void addXMLProduct(XMLProducts product){
		products.add(product);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
